package com.sugar.follow.up.module.business.controller.admin.followuprecord.vo;

import cn.idev.excel.annotation.ExcelIgnore;
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import cn.idev.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

import static com.sugar.follow.up.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

@Schema(description = "管理后台 - 随访发起记录 Response VO")
@Data
@ExcelIgnoreUnannotated
public class FollowUpRecordRespVO {

    @Schema(description = "随访记录ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26053")
    @ExcelProperty("随访记录ID")
    private Long id;

    @Schema(description = "随访模板ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "28969")
    @ExcelProperty("随访模板ID")
    private Long templateId;

    @Schema(description = "随访模板", requiredMode = Schema.RequiredMode.REQUIRED, example = "28969")
    @ExcelProperty("随访模板")
    private String templateName;

    @Schema(description = "用户ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29183")
    @ExcelIgnore
    private Long userId;

    @Schema(description = "就诊人ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29183")
    @ExcelIgnore
    private Long patientId;

    @Schema(description = "就诊人姓名", requiredMode = Schema.RequiredMode.REQUIRED, example = "29183")
    @ExcelProperty("就诊人姓名")
    private String patientName;

    @Schema(description = "就诊人手机号", requiredMode = Schema.RequiredMode.REQUIRED, example = "29183")
    @ExcelProperty("就诊人手机号")
    private String patientMobile;

    @Schema(description = "医生ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "32551")
    @ExcelIgnore
    private Long adminUserId;

    @Schema(description = "医生姓名", requiredMode = Schema.RequiredMode.REQUIRED, example = "32551")
    @ExcelProperty("医生姓名")
    private String adminUserName;

    @Schema(description = "随访标题", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("随访标题")
    private String title;

    @Schema(description = "随访简介", requiredMode = Schema.RequiredMode.REQUIRED)
    private String briefDescribe;

    @Schema(description = "随访开始时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("随访开始时间")
    @JsonSerialize(using = LocalDateTimeSerializer.class) // 序列化（响应）
    @JsonDeserialize(using = LocalDateTimeDeserializer.class) // 反序列化（请求）
    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime beginTime;

    @Schema(description = "随访结束时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("随访结束时间")
    @JsonSerialize(using = LocalDateTimeSerializer.class) // 序列化（响应）
    @JsonDeserialize(using = LocalDateTimeDeserializer.class) // 反序列化（请求）
    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime endTime;

    @Schema(description = "时长（小时）", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("时长（小时）")
    private Integer durationHour;

    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("创建时间")
    private LocalDateTime createTime;

    @Schema(description = "是否完成", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("是否完成")
    private Boolean isDone;

}
